package tech.aistar.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.mapper.UserMapper;
import tech.aistar.pojo.User;
import tech.aistar.service.IUserService;
import tech.aistar.until.MybatisUtil;

/**
 * @author Ray
 * @version 1.0
 * @description:本类用来演示:
 * @date 2019/9/5  16:38
 */
public class UserServiceImpl implements IUserService {
    @Override
    public User findByUsername(String username) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);

        User user = mapper.findByUsername(username);
        sqlSession.close();
        return user;
    }
}
